package com.jijs.guava.collect;

import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Maps;

import java.util.Map;

/**
 * Created by jjs on 2016/12/28.
 *
 * @author jijs
 */
public class MapDemo {

    /**
     * 创建Map
     */
    public static void test() {
        Map<String, Map<String, Integer>> map = Maps.newHashMap();

    }

    public static void test1() {
        Map<String, Boolean> map = ImmutableMap.of("ON", true, "OFF", false);
//        map.put("begin", true);
//        map.put("end", false);

        Map<String, String> map2 = new ImmutableMap.Builder<String, String>().put("a", "a").put("b", "b").build();
//        map2.put("c", "c");
        map2.forEach((k, v) -> System.out.println(v));

    }

    public static void test2() {

    }

    public static void test3() {

    }

    public static void test4() {

    }

    public static void test5() {

    }

    public static void test6() {

    }

    public static void main(String[] args) {

        test1();
    }

}
